home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / editors / mjovesrc.zoo / makefile < prev    next >
Makefile  |  1992-04-04  |  17KB  |  405 lines

  1. ###########################################################################
  2. # This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE #
  3. # is provided to you without charge, and with no warranty.  You may give  #
  4. # away copies of JOVE, including sources, provided that this notice is    #
  5. # included in all the files.                                              #
  6. ###########################################################################
  7.  
  8. # TMPDIR is where the tmp files get stored, usually /tmp or /tmp/jove.  If
  9. # your system does not remove subdirectories of /tmp on reboot (lots do
  10. # remove them these days) then it makes sense to make TMPDIR be /tmp/jove.
  11. # But if you want to recover buffers on system crashes, you should create a
  12. # directory that doesn't get cleaned upon reboot, and use that instead.
  13. # You would probably want to clean out that directory periodically with
  14. # /etc/cron.
  15. # RECDIR is the directory in which RECOVER looks for JOVE's tempfiles.
  16. #
  17. # JOVEHOME is the directory in which pieces of JOVE are kept.  It is only used
  18. #    in the default definitions of SHAREDIR, LIBDIR, BINDIR, and MANDIR.
  19. # SHAREDIR is for online documentation, and the system-wide .joverc file.
  20. # LIBDIR is for the PORTSRV and KBD processes and RECOVER.
  21. # BINDIR is where to put the executables JOVE and TEACHJOVE.
  22. # MANDIR is where the manual pages go for JOVE, RECOVER and TEACHJOVE.
  23. # MANEXT is the extension for the man pages, e.g., jove.1 or jove.l or jove.m.
  24. # DFLTSHELL is the default shell invoked by JOVE and TEACHJOVE.
  25. #
  26. # If they don't exist, this makefile will try to create the directories
  27. # LIBDIR and SHAREDIR.  All others must already exist.
  28.  
  29. CC = c:/gnu/bin/gcc.ttp
  30. SHELL = c:/ash.ttp
  31.  
  32. TMPDIR = d:\/\/tmp
  33. RECDIR = d:\/\/tmp\/\/preserve
  34.  
  35. JOVEHOME = c:\/\/jove
  36. SHAREDIR = $(JOVEHOME)\/\/lib
  37. LIBDIR = $(JOVEHOME)\/\/lib
  38. BINDIR = $(JOVEHOME)\/\/bin
  39. MANDIR = $(JOVEHOME)\/\/man\/\/man$(MANEXT)
  40. MANEXT = 1
  41. DFLTSHELL = c:\/\/ash.ttp
  42.  
  43. PROG = jove
  44. VERSION = 4.14
  45.  
  46. # These should all just be right if the above ones are.
  47. JOVE = $(BINDIR)\\\\jove.ttp
  48. TEACHJOVE = $(BINDIR)\\\\teachjov.ttp
  49. RECOVER = $(LIBDIR)\\\\recover
  50. PORTSRV = $(LIBDIR)\\\\portsrv
  51. KBD = $(LIBDIR)\\\\kbd
  52. JOVERC = $(SHAREDIR)\\\\jove.rc
  53. CMDS.DOC = $(SHAREDIR)\\\\cmds.doc
  54. TEACH-JOVE = $(SHAREDIR)\\\\teachjove
  55. JOVEM = $(MANDIR)\\\\jove.$(MANEXT)
  56. TEACHJOVEM = $(MANDIR)\\\\teachjov.$(MANEXT)
  57.  
  58. # Select the right libraries for your system.
  59. #    2.10BSD:LIBS = -ltermcap
  60. #    v7:    LIBS = -ltermcap
  61. #    4.1BSD:    LIBS = -ltermcap -ljobs
  62. #    4.2BSD:    LIBS = -ltermcap
  63. #    4.3BSD:    LIBS = -ltermcap
  64. #    SysV Rel. 2: LIBS = -lcurses
  65. #    SCO Xenix: LIBS = -ltermcap -lx
  66. #    SCO: LIBS = -lcurses
  67. #    AIX on the R6000s: LIBS = -lcurses
  68. #    MIPS: LIBS = -ltermcap
  69.  
  70. LIBS = -ltermcap
  71.  
  72. #    2.10BSD:LDFLAGS =
  73. #    v7:    LDFLAGS =
  74. #    4.1BSD:    LDFLAGS =
  75. #    4.2BSD:    LDFLAGS =
  76. #    4.3BSD:    LDFLAGS =
  77. #    SysV Rel. 2: LDFLAGS = -Ml
  78. #    SCO Xenix: LDFLAGS = -Ml -F 3000
  79. #    SCO Unix: LDFLAGS = 
  80. #
  81. # SEPFLAG should be:
  82. #    not on a PDP-11:        SEPFLAG =
  83. #    PDP-11 with separate I&D:    SEPFLAG = -i
  84. #    PDP-11 without separate I&D:    SEPFLAG = -n
  85. #
  86.  
  87. LDFLAGS =
  88.  
  89. SEPFLAG =
  90.  
  91. # define a symbol for your OS if it hasn't got one. sysdep.h tries to
  92. # use cpp predefined symbols to decide on the appropriate behaviour
  93. # in most cases. Exceptions are
  94. #     Apple A/UX on macIIs         SYSDEFS=-DA_UX
  95. #    SunOS4.0            SYSDEFS=-DSUNOS4
  96. #    MIPS RiscOS4.x            -systype bsd43
  97. #    SCO Unix            SYSDEFS=-DSCO -DSYSV
  98. #    IBM RS6000s            SYSDEFS=-DAIX -D_BSD -D_BSD_INCLUDES -D_NO_PROTO
  99. #    A system V system that doesn't
  100. #    define one of SVR2,SVR3,SYSV    SYSDEFS=-DSYSV
  101. #
  102. # You can just say 'make SYSDEFS=-Dwhatever' on these systems.
  103. SYSDEFS = -DBSD=1 -DMiNT=1
  104.  
  105. # for SCO Xenix, set
  106. #    MEMFLAGS = -Mle
  107. #    CFLAGS = -LARGE -O -F 3000 -K -Mle  (say -Mle2 for an 80286)
  108.  
  109. # you will want to add -O here for final cut
  110.  
  111. CFLAGS = $(SYSDEFS) -O -funsigned-char
  112.  
  113. # For cross compiling Jove, set CC to the cross compiler, and LOCALCC
  114. # to the local C compiler. LOCALCC will be used for compiling setmaps,
  115. # which is run as part of the compilation to generate the keymaps.
  116. # Set LOCALCFLAGS and LOCALLDFLAGS appropriately too. For Xenix, note
  117. # that LOCALCFLAGS must be set to $(MEMFLAGS)
  118.  
  119. LOCALCC = $(CC)
  120. LOCALCFLAGS = $(CFLAGS)    # $(MEMFLAGS)
  121. LOCALLDFLAGS = $(LDFLAGS)
  122.  
  123. BASESEG = funcdefs.o keys.o argcount.o ask.o buf.o ctype.o delete.o \
  124.       disp.o getch.o insert.o io.o jove.o loadavg.o marks.o misc.o re.o \
  125.       screen.o tune.o util.o vars.o version.o list.o keymaps.o
  126. OVLAY1 = abbrev.o rec.o paragraph.o fmt.o
  127. OVLAY2 = c.o wind.o fp.o move.o
  128. OVLAY3 = extend.o macros.o
  129. OVLAY4 = iproc.o re1.o
  130. OVLAY5 = proc.o scandir.o term.o case.o
  131.  
  132. OBJECTS = $(BASESEG) $(OVLAY1) $(OVLAY2) $(OVLAY3) $(OVLAY4) $(OVLAY5)
  133.  
  134. C_SRC = funcdefs.c abbrev.c argcount.c ask.c buf.c c.c case.c ctype.c \
  135.     delete.c disp.c extend.c fp.c fmt.c insert.c io.c iproc.c \
  136.     jove.c list.c loadavg.c macros.c marks.c misc.c move.c paragraph.c \
  137.     proc.c re.c re1.c rec.c scandir.c screen.c term.c util.c \
  138.     vars.c version.c wind.c getch.c mac.c keymaps.c pcscr.c
  139.  
  140. SOURCES = $(C_SRC) portsrv.c recover.c setmaps.c teachjove.c kbd.c
  141.  
  142. HEADERS = argcount.h buf.h chars.h ctype.h dataobj.h disp.h \
  143.     externs.h fp.h io.h iproc.h jove.h keymaps.h list.h mac.h \
  144.     re.h rec.h scandir.h screen.h sysdep.h temp.h termcap.h \
  145.     ttystate.h tune.h util.h vars.h wait.h wind.h
  146.  
  147.  
  148. DOCS1 =    doc/example.rc doc/jove.1 doc/jove.2 doc/jove.3 \
  149.     doc/jove.4 doc/jove.5 doc/jove.nr doc/system.rc \
  150.     doc/teach-jove doc/teachjove.nr doc/README doc/jove.qref
  151. DOCS2 = doc/cmds.doc.nr
  152. DOCS3 = doc/joveman doc/cmds.doc doc/manpage
  153. DOCS = $(DOCS1) $(DOCS2)
  154.  
  155. MISC = Makefile Makefile.dos tune.dos tune.template README Readme.dos \
  156.     Readme.mac iproc-pipes.c iproc-ptys.c
  157.  
  158. SUPPORT = teachjove.c recover.c setmaps.c portsrv.c kbd.c keys.txt \
  159.     macvert.c menumaps.txt mjovers.Hqx
  160.  
  161. BACKUPS = $(HEADERS) $(C_SRC) $(DOCS) $(SUPPORT) $(MISC)
  162.  
  163. all:    sdate xjove recover teachjove portsrv kbd macvert edate
  164.  
  165. sdate:
  166.     @echo "**** make started at this time ****"
  167.  
  168. edate:
  169.     @echo "**** make completed at this time ****"
  170.  
  171. xjove:    $(OBJECTS)
  172.     $(CC) $(LDFLAGS) -o xjove $(OBJECTS) $(LIBS)
  173.     @-size xjove
  174.  
  175. gjove:    $(OBJECTS)
  176.     ld -X /lib/gcrt0.o -o gjove $(OBJECTS) -lc $(LIBS)
  177.     @-size gjove
  178.  
  179. ovjove:    $(OBJECTS)
  180.     ld $(SEPFLAG) $(LDFLAGS) -X /lib/crt0.o \
  181.         -Z $(OVLAY1) \
  182.         -Z $(OVLAY2) \
  183.         -Z $(OVLAY3) \
  184.         -Z $(OVLAY4) \
  185.         -Z $(OVLAY5) \
  186.         -Y $(BASESEG) \
  187.         -o xjove $(LIBS) -lc
  188.     @-size xjove
  189.  
  190. portsrv:    portsrv.o
  191.     $(CC) $(LDFLAGS) -o portsrv $(SEPFLAG) portsrv.o $(LIBS)
  192.  
  193. kbd:    kbd.o
  194.     $(CC) $(LDFLAGS) -o kbd $(SEPFLAG) kbd.o $(LIBS)
  195.  
  196. recover:    rectune.h recover.o tune.o rec.h temp.h
  197.     $(CC) $(LDFLAGS) -o recover $(SEPFLAG) recover.o tune.o $(LIBS)
  198.  
  199. teachjov:    teachjov.o
  200.     $(CC) $(LDFLAGS) -o teachjove $(SEPFLAG) teachjove.o $(LIBS)
  201.  
  202. setmaps.ttp:    setmaps.o funcdefs.c
  203.     $(LOCALCC) $(LOCALLDFLAGS) -o setmaps.ttp setmaps.o
  204.  
  205. teachjov.o:    teachjov.c /usr/include/sys/types.h /usr/include/sys/file.h
  206.     $(CC) -c $(CFLAGS) -DTEACHJOVE=\"$(TEACH-JOVE)\" teachjove.c
  207.  
  208. # don't optimize setmaps.c because it produces bad code in some places
  209. # for some reason
  210. setmaps.o:    funcdefs.c keys.txt
  211.     $(LOCALCC) $(LOCALCFLAGS) -c setmaps.c
  212.  
  213. # ignore error messages from setmaps
  214. # it doesn't understand ifdefs
  215.  
  216. keys.c:    setmaps.ttp keys.txt
  217.     setmaps.ttp < keys.txt > keys.c
  218.  
  219. keys.o:    keys.c jove.h
  220.  
  221. tune.c: Makefile tune.template
  222.     -rm -f tune.c
  223.     @echo "/* Changes should be made in Makefile, not to this file! */" > tune.c
  224.     @echo "" >> tune.c
  225.     @sed -e 's;TMPDIR;$(TMPDIR);' \
  226.          -e 's;LIBDIR;$(LIBDIR);' \
  227.          -e 's;SHAREDIR;$(SHAREDIR);' \
  228.          -e 's;BINDIR;$(BINDIR);' \
  229.          -e 's;SHELL;$(DFLTSHELL);' tune.template >> tune.c
  230.  
  231. rectune.h: Makefile
  232.     -rm -f nrectune.h
  233.     @echo "/* Changes should be made in Makefile, not to this file! */" > nrectune.h
  234.     @echo "" >> nrectune.h
  235.     @echo \#define TMP_DIR \"$(TMPDIR)\" >> nrectune.h
  236.     @echo \#define REC_DIR \"$(RECDIR)\" >> nrectune.h
  237.     -cmp -s nrectune.h rectune.h || (rm -f rectune.h; cp nrectune.h rectune.h)
  238.  
  239. iproc.o: iproc-ptys.c iproc-pipes.c iproc.c
  240.     $(CC) -c $(CFLAGS) iproc.c
  241.  
  242. macvert:    macvert.c
  243.     $(CC) $(CFLAGS) -o macvert macvert.c
  244.  
  245. touch:
  246.     touch $(OBJECTS)
  247.  
  248. clean:
  249.     rm -f a.out core *.o keys.c tune.c xjove portsrv kbd recover setmaps.ttp \
  250.     teachjove macvert nrectune.h rectune.h \#* *~ make.lo